#include <stdio.h>
#include <stdlib.h>
#include "caesar.h"

void check_args(int argc);

int main(int argc, char *argv[])
{
    check_args(argc);
    char *mesg = argv[1];
    printf("Message: %s\n", mesg);
    caesar_encrypt_cstr(mesg);
    printf("Encrypted message: %s\n", mesg);
    caesar_decrypt_cstr(mesg);
    printf("Decrypted message: %s\n", mesg);

    return 0;
}

void check_args(int argc)
{
    if(argc != 2)
    {
        fprintf(stderr, "ERROR: wrong number of arguments: %d provided, 2 needed\n", argc);
        exit(1);
    }
}
